<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }

</script>
<div class="app">
    <section class="layout">
        <section class="main-content col-lg-6" id="inventoryLeftDiv">
            <div class="content-wrap" id="leftCenterDiv">
                <div class="wrapper" style="bottom: 50px;">
                    <ul class="nav nav-tabs">
                        <li class="active">
                            <a href="#"   onclick="loadDiv('mainCenterDiv','${ctx}/drug/drugInventoryCheck/profitLossIndex')">药品盘点盈亏通知</a>
                        </li>
                    </ul>
                    <section class="panel panel-default">
                        <div class="panel-body">
                            <div class="table-responsive no-border">
                                <div class="datatable-top">
                                    <div class="pull-left">
                                        <form:form id="searchForm" modelAttribute="drugInventoryCheck"  onsubmit="return loadDivForm('mainCenterDiv','searchForm','${ctx}/drug/drugInventoryCheck/profitLossIndex');" method="post" class="form-inline">
                                            <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                            <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                            <div class="form-group">
                                                <label>药品名称:</label>
                                                <form:input path="drugName" htmlEscape="false" maxlength="50" class="form-control"/>
                                                <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
                                            </div>

                                        </form:form>
                                    </div>
                                </div>
                                <div class="container-fluid">
                                    <table id="contentTable" class="table table-bordered mg-t datatable">
                                        <thead>
                                        <tr>
                                            <th rowspan="2">盘点时间</th>
                                            <th rowspan="2">药品名称</th>
                                            <th rowspan="2">包装规格</th>
                                            <th rowspan="2">包装单位</th>
                                            <th rowspan="2">单价/元</th>
                                            <th rowspan="2">调整前数量</th>
                                            <th rowspan="2">盘点数量</th>
                                            <th colspan="2">盘盈</th>
                                            <th colspan="2">盘亏</th>

                                        </tr>
                                        <tr>
                                            <th style="border-left: 1px solid #e3e6f3">数量</th>
                                            <th>金额/元</th>
                                            <th>数量</th>
                                            <th>金额/元</th>
                                        </tr>

                                        </thead>
                                        <tbody>
                                        <c:forEach items="${page.list}" var="check">
                                        <tr>
                                            <td><fmt:formatDate value="${check.createDate}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate> </td>
                                            <td> ${check.drugName}</td>
                                            <td> ${check.packageSpec}</td>
                                            <td> ${fns:getDictLabels(check.packageUnits, 'SPEC_UNIT', '')}</td>
                                            <td> ${check.purchasePrice}</td>
                                            <td> ${check.minQuantity}</td>
                                            <td> ${check.actualQuantity}</td>
                                            <td <c:if test="${check.overageNum>0}"> style="color: darkgreen;font-weight: bold" </c:if>> ${check.overageNum}</td>
                                            <td <c:if test="${check.overagePrice>0}"> style="color: darkgreen;font-weight: bold" </c:if>> ${check.overagePrice}</td>
                                            <td <c:if test="${check.lossNum>0}"> style="color: darkred;font-weight: bold" </c:if>> ${check.lossNum}</td>
                                            <td <c:if test="${check.lossPrice>0}"> style="color: darkred;font-weight: bold" </c:if>> ${check.lossPrice}</td>
                                        </tr>
                                        </c:forEach>
                                    </table>
                                    <div class="pagination">${page}</div>
                                </div>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </section>
    </section>
    </section>
</div>
